<?php

class AuthController extends admin_controllers_Controller
{
	protected function _authentificate()
	{}

    public function indexAction()
    {
        $form = new admin_core_Auth_Form_Login();

        $request = $this->getRequest();

        if ($request->isPost()) {
            if ($form->isValid($request->getPost())) {
                if ($this->getAuth()->authentificate($form->getValues())) {
                    $this->_helper->redirector('index', 'index');
                }
            }
        }

        $this->view->form = $form;
    }

    public function logoutAction()
    {
        admin_core_Auth::getInstance()->logout();

        $this->_helper->redirector('index');
    }
}